package com.lzh.others.basejava.Exception_12;

import cn.hutool.core.lang.Console;

/**
 * @author by lzh
 * @Classname InheritingExceptions
 * @Description 继承自定义异常的异常
 * @Date 2022/6/27 23:17
 */
public class InheritingExceptions {
    public void f() throws SimpleException {
        Console.log("Throw SimpleException from f()");
        throw new SimpleException();
    }

    public static void main(String[] args) {
        InheritingExceptions inheritingExceptions = new InheritingExceptions();
        try {
            inheritingExceptions.f();
        } catch (SimpleException e) {
            Console.log("Catch it ! : {}", e);
        }
    }
}
